import request from '@/config/axios'

// 教学 VO
export interface TeacherTeachVO {
  // 编号
  id: number
  // 教师工号
  teacherNumber: string
  // 教师姓名
  teacherName: string
  // 部门id
  deptId: number
  // 合计学时
  amount: string
  // 教师职称
  teacherTitle: number
  // 教师类别
  teacherCategory: number
}

// 教学 API
export const TeacherTeachApi = {
  // 查询教学分页
  getTeacherTeachPage: async (params: any) => {
    return await request.get({ url: `/data/teacher-teach/page`, params })
  },

  // 查询教学详情
  getTeacherTeach: async (id: number) => {
    return await request.get({ url: `/data/teacher-teach/get?id=` + id })
  },

  // 新增教学
  createTeacherTeach: async (data: TeacherTeachVO) => {
    return await request.post({ url: `/data/teacher-teach/create`, data })
  },

  // 修改教学
  updateTeacherTeach: async (data: TeacherTeachVO) => {
    return await request.put({ url: `/data/teacher-teach/update`, data })
  },

  // 删除教学
  deleteTeacherTeach: async (id: number) => {
    return await request.delete({ url: `/data/teacher-teach/delete?id=` + id })
  },

  // 导出教学 Excel
  exportTeacherTeach: async (params) => {
    return await request.download({ url: `/data/teacher-teach/export-excel`, params })
  },

  // ==================== 子表（教学表任务统计） ====================

  // 获得教学表任务统计分页
  getTeacherTeachTaskPage: async (params) => {
    return await request.get({ url: `/data/teacher-teach/teacher-teach-task/page`, params })
  },
  // 新增教学表任务统计
  createTeacherTeachTask: async (data) => {
    return await request.post({ url: `/data/teacher-teach/teacher-teach-task/create`, data })
  },

  // 修改教学表任务统计
  updateTeacherTeachTask: async (data) => {
    return await request.put({ url: `/data/teacher-teach/teacher-teach-task/update`, data })
  },

  // 修改教学表任务状态
  updateTeacherTeachTaskStatus: async (data) => {
    return await request.put({ url: `/data/teacher-teach/teacher-teach-task/updateStatus`, data })
  },

  // 删除教学表任务统计
  deleteTeacherTeachTask: async (id: number) => {
    return await request.delete({ url: `/data/teacher-teach/teacher-teach-task/delete?id=` + id })
  },

  // 获得教学表任务统计
  getTeacherTeachTask: async (id: number) => {
    return await request.get({ url: `/data/teacher-teach/teacher-teach-task/get?id=` + id })
  }
}
